﻿@using KPIS.GERP.Models.ICM
@model IEnumerable<KPIS.GERP.Models.ICM.Asset>

@{
    ViewBag.Title = "ระบบควบคุมและจำหน่ายพัสดุ";
    ViewBag.Descr = "ทะเบียนควบคุมพัสดุ-วัสดุ";
    var ResTypeId = ViewBag.ResTypeId;
}


@using (Html.BeginForm("Index", "ParcelControlAssetList", FormMethod.Post))
{
    @Html.AntiForgeryToken()
    <div class="row-fluid">
        <div class="control-group" style="width: 700px; margin-left: 370px;">
            <div class="control-label" style="float: left; width: 120px; margin-right: 0px; margin-top: 4px;">
               เลือกประเภทพัสดุ :
            </div>
            <div class="controls" style="float: left; width: 400px; margin-left: 0px;">
                @Html.DropDownList("ResTypeId", new KPIS.GERP.WEB.GIMS.MasResourceService.MasResourceServiceClient().SelectListResourceType(null)
                        , new { id = "lenderType" })
            </div>
            <div class="clear" style="clear: both; width: 0px; height: 0px;"></div>
        </div>
    </div>
}


@section scripts
{
<script type="text/javascript">
    $(document).ready(function () {
        $('#lenderType').change(function () {
            var resType = parseInt($('#lenderType').val());

            if (resType == null) {
            }
            else if (resType == 1) {
                window.location.href = "../ParcelControlAssetList/IndexOfficeSuppliesLot ";
            }
            else {
                window.location.href = "../ParcelControlAssetList/IndexAsset";
            }
        });
    });
</script>
 }